//
//  ServiceSubscribe.h
//  suRead
//
//  Created by lidi on 2018/11/28.
//  Copyright © 2018 bao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ServiceUtils.h"

NS_ASSUME_NONNULL_BEGIN

//1.楚天+首页新闻列表接口（登录/未登录）
static NSString *url_service_list = @"http://www.ctdsb.net/index.php?m=app&c=weixin&a=service_list";

//2.服务号分类
static NSString *url_classify = @"http://www.ctdsb.net/index.php?m=app&c=weixin&a=classify";

//3.某分类服务号下的列表接口
static NSString *url_service_pid_list = @"http://www.ctdsb.net/index.php?m=app&c=weixin&a=service_pid_list";

//4.某服务号下的新闻列表接口
static NSString *url_sevice_wid_list = @"http://www.ctdsb.net/index.php?m=app&c=weixin&a=sevice_wid_list";

//5.服务号新闻详情接口
static NSString *url_service_wid_info = @"http://www.ctdsb.net/index.php?m=app&c=weixin&a=service_wid_info";

//6.用户已订阅服务号列表接口
static NSString *url_service_uid_list = @"http://www.ctdsb.net/index.php?m=app&c=weixin&a=service_uid_list";

//7.用户订阅接口
static NSString *url_service_subscribe = @"http://www.ctdsb.net/index.php?m=app&c=weixin&a=service_subscribe";

//8.用户取消订阅接口
static NSString *url_service_unsubscribe = @"http://www.ctdsb.net/index.php?m=app&c=weixin&a=service_unsubscribe";

///订阅号相关接口
@interface ServiceSubscribe : NSObject

/**
 *  1.楚天+首页新闻列表接口（登录/未登录）
 *
 *  @param userid 用户id,为空则未登录
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchServiceList:(NSString *)userid_
                                   pageindex:(NSInteger)pageindex_
                                    pagesize:(NSInteger)pagesize_
                                     success:(void (^)(id responseObject,NSString *message))success_
                                     failure:(void (^)(NSString *message))failure_;

/**
 *  2.服务号分类
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchClassify:(void (^)(id responseObject,NSString *message))success_
                                  failure:(void (^)(NSString *message))failure_;

/**
 *  3.某分类服务号下的列表接口
 
 *  @param pid_ 父级id（服务号分类id）
 *  @param userid_ 用户id,为空则未登录
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchServicePidList:(NSInteger)pid_
                                         userid:(NSString *)userid_
                                      pageindex:(NSInteger)pageindex_
                                       pagesize:(NSInteger)pagesize_
                                        success:(void (^)(id responseObject,NSString *message))success_
                                        failure:(void (^)(NSString *message))failure_;

/**
 *  4.某服务号下的新闻列表接口
 
 *  @param wid_ 服务号id
 *  @param userid_ 用户id,为空则未登录
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchServiceWidList:(NSInteger)wid_
                                         userid:(NSString *)userid_
                                      pageindex:(NSInteger)pageindex_
                                       pagesize:(NSInteger)pagesize_
                                        success:(void (^)(id responseObject,NSString *message))success_
                                        failure:(void (^)(NSString *message))failure_;

/**
 *  5.服务号新闻详情接口
 
 *  @param wid_ 服务号id
 *  @param userid_ 用户id,为空则未登录
 *  @param aid_ 新闻id
 *  @param type_ 新闻类型（doc, slide）
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchServiceWidInfo:(NSString *)wid_
                                         userid:(NSString *)userid_
                                            aid:(NSString *)aid_
                                           type:(NSString*)type_
                                        success:(void (^)(id responseObject,NSString *message))success_
                                        failure:(void (^)(NSString *message))failure_;

/**
 *  6.用户已订阅服务号列表接口
 
 *  @param userid_ 用户id,为空则未登录
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchServiceUidList:(NSString *)userid_
                                      pageindex:(NSInteger)pageindex_
                                       pagesize:(NSInteger)pagesize_
                                        success:(void (^)(id responseObject,NSString *message))success_
                                        failure:(void (^)(NSString *message))failure_;

/**
 *  7.用户订阅接口
 
 *  @param wid_ 服务号id
 *  @param userid_ 用户id,为空则未登录
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doServiceSubscribe:(NSInteger)wid_
                                      userid:(NSString *)userid_
                                     success:(void (^)(id responseObject,NSString *message))success_
                                     failure:(void (^)(NSString *message))failure_;

/**
 *  8.用户取消订阅接口
 
 *  @param wid_ 服务号id
 *  @param userid_ 用户id,为空则未登录
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doServiceUnsubscribe:(NSInteger)wid_
                                      userid:(NSString *)userid_
                                     success:(void (^)(id responseObject,NSString *message))success_
                                     failure:(void (^)(NSString *message))failure_;

@end

NS_ASSUME_NONNULL_END
